﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate.Mappings;
using System.Security.Principal;

namespace Apollo
{
    [Serializable]
    [NHibernateEntity(Table = "Users")]
    public class UserCommon : MarshalByRefObject, IUser, ILegacy
    {
        public UserCommon() { }

        public virtual bool IsAuthenticated { get; set; }

        [PrimaryKey]
        public virtual int Id { get; set; }

        [Property]
        public virtual string AuthenticationType { get; set; }

        [Property]
        public virtual string Name { get; set; }

        [Property]
        public virtual string Password { get; set; }

        [BelongsTo(Column = "ID_Language")]
        public virtual Language Language { get; set; }

        [BelongsTo(Column = "ID_Role")]
        public virtual Role Role { get; set; }

        [BelongsTo(Column = "ID_Position")]
        public virtual Position Position { get; set; }

        [BelongsTo(Column = "ID_Employee")]
        public virtual Employee Employee { get; set; }

        [BelongsTo(Column = "ID_Impersonate_User")]
        public virtual User Impersonate { get; set; }


        [Property]
        public virtual DateTime LastLoginDate { get; set; }

        [Property]
        public virtual bool IsActive { get; set; }

        [Property]
        public virtual DateTime InsertDate { get; set; }

        [Property]
        public virtual string InsertBy { get; set; }

        [Property]
        public virtual DateTime? ModifiedDate { get; set; }

        [Property]
        public virtual string ModifiedBy { get; set; }

        [Property]
        public virtual string LegacyApplication { get; set; }

        [Property]
        public virtual string LegacyID { get; set; }
    }
}
